<?php
namespace Home\Controller;
use Think\Controller;

class CommonController extends Controller {

    public function pDisplay( $tpl='', $isShowMenu=false ){
    	$header = $this->pHeader();

    	$body = $this->pBody( $tpl );

        $menu = '';
        if ($isShowMenu) {
            $menu = $this->pMenu();
        }

    	$footer = $this->pFooter();

    	$content = $header . $menu . $body . $footer;

    	$this->display('', '', '', $content);
    }

    public function pFetch($tpl){
        $content = '';
        $content = $this->fetch($tpl);
        return $content;
    }

    public function pHeader(){
        return $this->pFetch( T('Public/header') );
    }

    public function pFooter(){
        return $this->pFetch( T('Public/footer') );
    }

    public function pBody( $tpl='' ){
        return $this->pFetch( $tpl );
    }

    public function pMenu(){
        return $this->pFetch( T('Public/menu') );
    }



    public function EE( $ee ){
        echo "<pre>";
        print_r($ee);
        exit;
    }

}
